using AuthenticationDemo.Models.Application;
using AuthenticationDemo.Models.Base;
using AuthenticationDemo.Services;
using DockerProject.Common;
using DockerProject.Models.Enum;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;

namespace AuthenticationDemo.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    [AllowAnonymous]
    public class LoginController : ControllerBase
    {
        private readonly AuthService _service;

        public LoginController(AuthService service)
        {
            _service = service;
        }

        [HttpGet]
        public async Task<ResponseBase<object>> Temporary_Login(string user = "admin", string password = "admin999")
        {
            var res = await _service.GetTemporaryToken(user, password);
            return res;
        }

        [HttpGet]
        public async Task<ResponseBase<ApiFixedClientResp>> FixedClient_Login(string clientId = "A75E3F4C6CEC13FFBF250FA6DC541003")
        {
            var res = await _service.GetFixedClientToken(clientId);
            return res;
        }

    }
}